package mindteck.store;

import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class Online_Servlet
 */
public class Online_Servlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

    /**
     * Default constructor. 
     */
    public Online_Servlet() {
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see Servlet#init(ServletConfig)
	 */
	public void init(ServletConfig config) throws ServletException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see Servlet#destroy()
	 */
	public void destroy() {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request,response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String First_name = request.getParameter("first_name");
		String lastName = request.getParameter("lastName");
		String Address = request.getParameter("Address");
		String Credit_Card_Number = request.getParameter("Credit_Card_Number");
		String Shipping_Info = request.getParameter("Shipping_Info");
		String Phone_Number = request.getParameter("Phone Number");
		String Password = request.getParameter("Password");
		String Log_in_ID = request.getParameter("Log_in_ID");
		

		
			CustomerBean Cust= new CustomerBean();
			CustomerDAO CustDAO= new CustomerDAO();
			
		Cust.setFirstName(First_name);
		Cust.setLastName(lastName);
		Cust.setCreditCardInfo(Credit_Card_Number);
		Cust.setAddress( Address);
		Cust.setShippingInfo(Shipping_Info);
		Cust.setPhoneNumber(Phone_Number);
		
		
		Customer oj = new Customer(Cust);
		oj.register(CustDAO);
		
	}

}
